<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Page</title>
</head>
<body>
	
	<%--Always destroy session at this page--%>
	<%
		request.getSession().invalidate();
	%>
	
	<%--The LOGIN and PASSWORD form--%>
	<form action="login-servlet" method="post" name="loginform">
		<center>
			<h2>Login:</h2>
			<input type="text" name="login"> <br>
			<h2>Password:</h2>
			<input type="password" name="password"> <br> <br> 
			<input type="submit" value="Log IN" onclick="return CheckInfo()">
		</center>
	</form>
	
	<%--Check if the fields are not empty--%>
	<script language="javascript" type="text/javascript">
		function CheckInfo(){
			if(document.forms.loginform.login.value !=""){
				
			} else {
				alert("Please, enter your LOGIN");
				document.forms.loginform.login.focus();
				return false;
			}
			if(document.forms.loginform.password.value !=""){
				
			} else {
				alert("Please, enter your PASSWORD");
				document.forms.loginform.password.focus();
				return false;
			}
		}
	</script>
	
</body>
</html>